// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   StringRenderer.java

package com.boci.common.ui.control;

import java.awt.Color;
import java.awt.Component;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.border.EmptyBorder;
import javax.swing.table.TableCellRenderer;

public class StringRenderer extends JLabel
    implements TableCellRenderer
{

    public StringRenderer()
    {
        setBorder(new EmptyBorder(0, 2, 0, 2));
    }

    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
    {
        if(value != null)
        {
            setToolTipText(value.toString());
            setText(value.toString());
        }
        setOpaque(true);
        if(row % 2 == 0)
        {
            setBackground(new Color(255, 255, 200));
            setForeground(table.getForeground());
        } else
        {
            setBackground(Color.WHITE);
            setForeground(table.getForeground());
        }
        return this;
    }
}
